package com.kan.awaits.mongo.query;

import java.util.HashSet;
import java.util.Set;

import com.mongodb.BasicDBObject;
import com.mongodb.DBObject;

/**
 * Use Example to find entity
 * 
 * @author john
 * @date 2011-4-13
 */
public class Example
{
	private Object entity;

	private boolean dirty;

	private Set<String> ignoreProperties = new HashSet<String>();

	public Example(Object entity)
	{
		this.entity = entity;
	}

	public Example ignoreProperty(String propertyName, boolean ignore)
	{
		if (ignore)
		{
			ignoreProperties.add(propertyName);
		} else
		{
			ignoreProperties.remove(propertyName);
		}
		return this;
	}

	public Example ignoreProperty(String propertyName)
	{
		return ignoreProperty(propertyName, true);
	}

	DBObject getDbObject()
	{
		DBObject dbObject = new BasicDBObject();
		// dbObject.put("", arg1);
		return dbObject;
	}
}
